#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int a(int tab)
{
	int n= tab - 1;
	n|= n>> 1;
	n|= n>> 2;
	n|=n>> 4;
	n|= n>> 8;
	n|= n>> 16;
	return n;
}
int main()
{
	printf("%d\n", a(666));
	return 0;
}